package com.ruoyi.common.exception;

import com.ruoyi.common.enums.ExceptionStatusEnum;

public class BusinessException extends RuntimeException{
    /**
     * 错误码
     */
    private int code;

    /**
     * 错误提示
     */
    private String message;

    public BusinessException(ExceptionStatusEnum exceptionStatusEnum) {
        this.message = exceptionStatusEnum.getMsg();
        this.code = exceptionStatusEnum.getStatus();
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
